<template>
  <component :is="current" />
</template>
<script>
import versionDefault from './versionDefault'
export default {
  // 交付得分
  name: 'ProjectScore',
  components: { versionDefault },
  data() {
    return {
      current: '',
      query: {},
      versionComponents: ['']
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      this.query = this.$route.query
      if (this.versionComponents.some(comp => comp === this.query.specialRule)) {
        this.current = this.query.specialRule
      } else {
        this.current = 'versionDefault'
      }
    },
    async validate() {
      return this.$refs[this.current]?.validate()
    }
  }
}
</script>
